<%@ page contentType="text/html;charset=UTF-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
    <title>个人日记用户登录</title>
    <style>

        body {
            background: #f5f5f5;
            font-family: Arial, sans-serif;
            display: flex;
            justify-content: center;
            align-items: center;
            height: 100vh;
            margin: 0;
        }

        .login-container {
            background: white;
            padding: 2rem;
            border-radius: 8px;
            box-shadow: 0 2px 10px rgba(0,0,0,0.1);
            width: 350px;
        }

        .login-title {
            font-size: 24px;
            color: #333;
            margin-bottom: 1.5rem;
            text-align: center;
        }

        .form-group {
            margin-bottom: 1rem;
        }

        input[type="text"],
        input[type="password"] {
            width: 100%;
            padding: 8px;
            border: 1px solid #ddd;
            border-radius: 4px;
            box-sizing: border-box;
        }

        .remember-me {
            margin: 1rem 0;
        }

        .login-button {
            width: 100%;
            padding: 10px;
            background: #007bff;
            color: white;
            border: none;
            border-radius: 4px;
            cursor: pointer;
        }

        .register-link {
            text-align: center;
            margin-top: 1rem;
        }
    </style>
</head>
<body>
<div class="login-container">
    <!-- 原有功能完全保留 -->
    <h1 class="login-title">登录</h1>

    <%-- 错误提示保持原有逻辑 --%>
    <c:if test="${not empty error}">
        <div style="color: red; margin-bottom: 1rem;">${error}</div>
    </c:if>

    <form action="${pageContext.request.contextPath}/login" method="POST">
        <div class="form-group">
            <label>用户名：</label>
            <input type="text" name="username" required>
        </div>

        <div class="form-group">
            <label>密码：</label>
            <input type="password" name="password" required>
        </div>

        <div class="remember-me">
            <input type="checkbox" id="remember" name="remember">
            <label for="remember">记住我</label>
        </div>

        <button type="submit" class="login-button">登录</button>
    </form>

    <div class="register-link">
        没有账号？<a href="${pageContext.request.contextPath}/register">立即注册</a>
    </div>
</div>
</body>
</html>